feat(registry-webhook-sync): Introducing Terraform Registry webhook sync workflow 🚀 #400
Merged
Conversation
Adds registry-webhook-sync.yml, a reusable + dispatchable workflow that audits the Terraform Registry webhook on every terraform-* repo across one or more orgs and ensures it fires on push,create,delete (not push only), so module tags cut via the GitHub Release UI/API also reach the registry without a manual "Resync Module". - registry-webhook-sync.yml: audit/fix hooks, dry_run mode, job summary - docs/registry-webhook-sync.md: problem writeup, inputs/secrets, cron caller - WORKFLOW_CATALOG.md: catalog entry
hahirwar-cd
approved these changes
Jun 29, 2026
dverma-cd
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
New tags for
terraform-aws-*modules sometimes don't appear on the public Terraform Registry, forcing a manual Resync Module click in the registry UI. This automates the fix and makes it self-healing across orgs.Root cause (investigated, with live evidence)
The registry installs a GitHub webhook per published repo. On every clouddrove module repo that hook is subscribed to
pushonly:git push origin <tag>(ourrelease-tag.yml) fires apushevent → registry syncs ✅create+release, often notpush→ the push-only hook never hears it → registry lags → manual resyncThere is no public registry API to force a resync (UI-only; the v2
can-resyncaction needs a fragile registry session token). So the durable fix is correcting the GitHub webhook, not calling the registry.Evidence gathered (read-only, against clouddrove)
1. Org-wide webhook audit (dry-run, 177
terraform-*repos):["push"]only → would fix to["push","create","delete"]2. git-tag vs registry-version spot check (v-prefix normalized):
So most modules sync fine (push-driven); the misses are intermittent and align with manually-cut releases (e.g. s3
v2.0.2was a hand-cut GitHub Release). GitHub had purged old webhook delivery history, so the exact missed delivery couldn't be replayed — diagnosis rests on the audit + lag correlation + HashiCorp's documented requirement that the registry webhook fire on tag-creation events.3. Reconcile logic validated against live repos in dry-run — drift detection correctly reports
have=["push"] missing=["create","delete"]per repo and makes no changes indry_runmode.What this PR adds
.github/workflows/registry-webhook-sync.yml— reusable (workflow_call) +workflow_dispatch. Loops orgs →terraform-*repos → finds the registry hook → adds missingcreate/deleteevents. Hasdry_run, writes a job-summary report, leaves repos with no registry hook untouched (reported only).docs/registry-webhook-sync.md— problem writeup, inputs/secrets, scheduled cron caller example.WORKFLOW_CATALOG.md— catalog entry.Inputs:
orgs(csv, required),repo_filter(default^terraform-),required_events(defaultpush,create,delete),dry_run. Secret:GH_ADMIN_TOKEN(PAT withadmin:repo_hook+reporead).Honest scope / caveats
Validation done
name:+jobs:(passesci.ymlstructure checks).dry_runagainst clouddrove — results above.Follow-ups (not in this PR)